//! @Author: DengLibin 榆霖
//! @Date:  2022-07-05 13:52:44
//! @Description: 

use serde::{Serialize, Deserialize};

pub mod page;


#[derive(Debug, Serialize, Deserialize)]
pub struct ResData<'a, T> {
    pub code: u8,
    pub msg: &'a str,
    pub data: T
}

impl <T>ResData<'static, T> {

    pub fn success(data: T) -> Self{
        ResData { code: 0, msg: "success", data: data }
    }
    pub fn fail(msg: &'static str, data: T) -> Self{
        ResData {code: 1, msg: msg, data: data }
    }
}